package com.cn.lotary.base.dao;

import java.util.List;
import java.util.Map;
import javax.faces.application.FacesMessage;

/**
 *
 * @author Jason May 24, 2011
 */
public interface DaoInterfaces<T extends AbstractEntity> {

    /**
     * @param t
     * @return FacesMessage
     */
    FacesMessage create(T t);

    /**
     * @param t
     * @return FacesMessage
     */
    FacesMessage remove(T t);

    /**
     * @param t
     * @return FacesMessage
     */
    FacesMessage update(T t);

    /**
     *
     * @param id entity primekey
     * @return Entity
     */
    T find(String id);

    /**
     *
     * @param first start row
     * @param pageSize row count
     * @param filters map<'column','column alue'>
     * @param sort order by
     * @return Entity list
     */
    public List<T> find(int first, int pageSize, Map<String, String> filters, String sort);

    /**
     *
     * @return row count
     */
    int getCount();

    /**
     *
     * @return All Entity
     */
    List<T> findAll();
}
